import request from '@/utils/request'

// 获取请求日志列表
export function getRequestLogs(params) {
  return request({
    url: '/logs/request-logs',
    method: 'get',
    params
  })
}

// 获取请求日志详情
export function getRequestLogDetail(id) {
  return request({
    url: `/logs/request-logs/${id}`,
    method: 'get'
  })
}

// 批量删除请求日志
export function deleteRequestLogsBatch(days) {
  return request({
    url: '/logs/request-logs/batch',
    method: 'delete',
    params: { days }
  })
}

// 获取登录历史列表
export function getLoginHistories(params) {
  return request({
    url: '/logs/login-history',
    method: 'get',
    params
  })
}

// 批量删除登录历史
export function deleteLoginHistoriesBatch(days) {
  return request({
    url: '/logs/login-histories/batch',
    method: 'delete',
    params: { days }
  })
}
